from bigdl.llm.transformers import AutoModelForCausalLM
from transformers import AutoTokenizer
import os
if __name__ == '__main__':
  model_path = os.path.join(os.getcwd(),"Qwen-1_8B-Chat")
  model = AutoModelForCausalLM.from_pretrained(model_path, load_in_low_bit='sym_int4', trust_remote_code=True)
  tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
  model.save_low_bit('qwen18chat_int4')
  tokenizer.save_pretrained('qwen18chat_int4')